package com.ceba.test.modules.regist.service;

import abc.data.DataTable;
import com.ceba.base.helper.DBJSONHelper;
import com.ceba.test.modules.regist.dao.EnterpriseRegistDao;
import com.ceba.test.modules.regist.dao.NewEnterpriseRegistDao;
import com.ceba.test.modules.regist.entity.EnterpriseRegist;
import com.ceba.test.modules.regist.entity.EnterpriseRegistLic;

import java.util.Date;
import java.util.Map;

public class NewEnterpriseRegistService {

    private NewEnterpriseRegistDao newEnterpriseRegistDao;

    private EnterpriseRegistDao enterpriseRegistDao;

    public String queryEnterpriseRegistLicAll(String key, Map<String, Object> dic,String type) {
        DataTable dt  = newEnterpriseRegistDao.queryEnterpriseRegistLicAll(key,dic,type);
        if(dt !=null && dt.getRowCount()>0){
            return dt.toJSON();
        }else{
            return DBJSONHelper.getEmptyDBJSONString();
        }
    }

    /**
     *
     * 修改lic
     * @param lic
     */

    public  boolean updateEnterpriseRegistLic (EnterpriseRegistLic lic) throws  Exception{
        return  newEnterpriseRegistDao.updateEnterpriseRegistLic(lic);
    }

    /**
     *
     * 增加lic
     * @param lic
     */

    public  boolean addEnterpriseRegistLic (EnterpriseRegistLic lic) throws  Exception{
        return  newEnterpriseRegistDao.addEnterpriseRegistLic(lic);
    }



    /**
     *根据客户获取信息Id 获取license 对象
     *
     */
    public EnterpriseRegistLic getEnterpriseRegistLic(String enterpriseId) throws  Exception{
       return  newEnterpriseRegistDao.getEnterpriseRegistLic(enterpriseId);
    }

    public Boolean add(EnterpriseRegist elog) throws Exception{
        return enterpriseRegistDao.add(elog);
    }


    public boolean getDeleteNewEnterpriseRegist(String enterpriseId){
        return newEnterpriseRegistDao.getDeleteNewEnterpriseRegist(enterpriseId);
    }

    public NewEnterpriseRegistDao getNewEnterpriseRegistDao() {
        return newEnterpriseRegistDao;
    }

    public void setNewEnterpriseRegistDao(NewEnterpriseRegistDao newEnterpriseRegistDao) {
        this.newEnterpriseRegistDao = newEnterpriseRegistDao;
    }
}
